﻿using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class ForAds : MonoBehaviour {

    // Use this for initialization
    void Start () {
        if (PlayerPrefs.GetInt("IsBuy") == 0)
        {
            EventCenter.AddListener(EGameEvent.eBuyAndRemovedAds, RmoveAds);
            GoogleMobileAdsScript.Instance.RequestBanner();
        }
    }
    void RmoveAds()
    {
        GoogleMobileAdsScript.Instance.HideBanner();
    }

    void OnDestroy()
    {
        if (PlayerPrefs.GetInt("IsBuy") == 0)
            EventCenter.RemoveListener(EGameEvent.eBuyAndRemovedAds, RmoveAds);
    }
    // Update is called once per frame
}
